package com.itboye.sunsun.person.ui;

import java.util.ArrayList;
import java.util.List;

import com.itboye.sunsun.R;
import com.itboye.sunsun.Application.App;
import com.itboye.sunsun.adapter.CustomListViewAdapter;
import com.itboye.sunsun.beans.CustomBean;
import com.itboye.sunsun.custome.XListView;

import android.app.Activity;
import android.os.Bundle;

public class CustomActivity extends Activity{
	
	
	private XListView xListView;
	private List<CustomBean> list;
	private CustomListViewAdapter customAdapter;

	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_custom);
		initView();
		initData();
	}
	
	public void initView()
	{
		xListView=(XListView) findViewById(R.id.xlistview);
	}
	public void initData()
	{
		list=new ArrayList<CustomBean>();	
		CustomBean customBean1=new CustomBean();
		customBean1.setType(1);
		customBean1.setValue("haha");
		CustomBean customBean2=new CustomBean();
		customBean2.setType(2);
		customBean2.setValue("haha");
		CustomBean customBean3=new CustomBean();
		customBean3.setType(3);
		customBean3.setValue("haha");
		list.add(customBean1);
		list.add(customBean2);
		list.add(customBean3);
		customAdapter=new CustomListViewAdapter(App.ctx, list);
		xListView.setAdapter(customAdapter);
	}
}
